
const mongoose = require("mongoose");

const schema = new mongoose.Schema({//收藏夹集合(favorites)
    articleId: [//收藏夹里的商品
        {//从属的商品id
            type: mongoose.Schema.Types.ObjectId,
            ref: "goods"
        }
    ],
    userId: {//收藏夹从属的用户
        type: mongoose.Schema.Types.ObjectId,
        ref: "users"
    },
})
mongoose.model("favorites", schema, "favorites");